package com.king.java.tools.http.entity;


import java.util.HashMap;
import java.util.Map;

/**
 * 描述: 请求实体
 *
 * @author : sujinchen
 * @date : 2020/10/15
 */
public class HttpJsonEntity {
    /**
     * 请求地址
     * 必须以/开头
     */
    private String url="";

    /**
     * 请求方式
     * 默认GET
     */
    private HttpMethod method = HttpMethod.GET;
    /**
     * 请求头
     */
    private Map<String, String> reqHeaders = new HashMap<>();


    /**
     * json类型
     */
    private String mediaType = "application/json; charset=utf-8";

    /**
     * 请求体
     */
    private String reqBody="";

    /**
     * 文件地址
     */
    private String filePath;

    /**
     * 文件名称
     */
    private String fileName;



    public HttpJsonEntity() {
    }

    public HttpJsonEntity(String url) {
        this.url = url;
    }


    public void addHead(String key1, String value) {
        reqHeaders.put(key1, value);
    }

    public String getUrl() {
        return url;
    }

    public HttpMethod getMethod() {
        return method;
    }

    public Map<String, String> getReqHeaders() {
        return reqHeaders;
    }

    public String getMediaType() {
        return mediaType;
    }

    public String getReqBody() {
        return reqBody;
    }

    public String getFilePath() {
        return filePath;
    }

    public String getFileName() {
        return fileName;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public void setMethod(HttpMethod method) {
        this.method = method;
    }

    public void setReqHeaders(Map<String, String> reqHeaders) {
        this.reqHeaders = reqHeaders;
    }

    public void setMediaType(String mediaType) {
        this.mediaType = mediaType;
    }

    public void setReqBody(String reqBody) {
        this.reqBody = reqBody;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }
}
